﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace GameEngine.utils.console
{
    public class SuperConsole
    {
        public bool writeAll = false;
        public bool writeSimpleStrings = true;
        public bool writeBattleCommandList = false;
        public bool writeBattleCommand = false;
        protected static SuperConsole instance;
        protected SuperConsole() { 
            
        }
        public static SuperConsole getInstance() {
            if (instance == null) {
                instance = new SuperConsole();
            }
            return instance;
        }

        public void write(string str) {
            if (!writeAll && !writeSimpleStrings) return;
            Console.WriteLine(str);
        }
     
        public void write(string str, ConsoleColor foregroundColor)
        {
            setForegroundColor(foregroundColor);
            write(str);
            resetConsoleColor();
        }
        public void write(string str, ConsoleColor foregroundColor, ConsoleColor backgroundColor)
        {
            setBackgroundColor(backgroundColor);
            setForegroundColor(foregroundColor);
            write(str);
            resetConsoleColor();
        }
        private void resetConsoleColor() {
            Console.ResetColor();
        }
        private void setBackgroundColor(ConsoleColor cc)
        {
            Console.BackgroundColor = cc;
        }
        private void setForegroundColor(ConsoleColor cc)
        {
            Console.ForegroundColor = cc;
        }
    }
}
